package com.example.kt_base.s4

//TODO 58.Kotlin语言的可变List集合
fun main() {
    val list= mutableListOf("derry","zhangShang","wangWu")
    list.add("赵六")
    list.remove("derry")
    println(list)

    //不可变集合变可变集合
    val list2= listOf(123,456,789)
    val list3:MutableList<Int> = list2.toMutableList()
    list3.add(111)
    list3.remove(123)
    println(list3)

    //可变集合变不可变集合
    val list5=list3.toList()


}
